package com.ruoyi.cbs.evaluate.service.impl;

import java.util.List;

import com.ruoyi.cbs.evaluate.domain.EvaluateRating;
import com.ruoyi.cbs.evaluate.mapper.EvaluateRatingMapper;
import com.ruoyi.cbs.evaluate.service.IEvaluateRatingService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 承包商综合评级Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-11
 */
@Service
public class EvaluateRatingServiceImpl implements IEvaluateRatingService
{
    @Autowired
    private EvaluateRatingMapper evaluateRatingMapper;

    /**
     * 查询承包商综合评级
     * 
     * @param id 承包商综合评级主键
     * @return 承包商综合评级
     */
    @Override
    public EvaluateRating selectEvaluateRatingById(Long id)
    {
        return evaluateRatingMapper.selectEvaluateRatingById(id);
    }

    /**
     * 查询承包商综合评级列表
     * 
     * @param evaluateRating 承包商综合评级
     * @return 承包商综合评级
     */
    @Override
    public List<EvaluateRating> selectEvaluateRatingList(EvaluateRating evaluateRating)
    {
        return evaluateRatingMapper.selectEvaluateRatingList(evaluateRating);
    }

    /**
     * 新增承包商综合评级
     * 
     * @param evaluateRating 承包商综合评级
     * @return 结果
     */
    @Override
    public int insertEvaluateRating(EvaluateRating evaluateRating)
    {
        evaluateRating.setCreateTime(DateUtils.getNowDate());
        return evaluateRatingMapper.insertEvaluateRating(evaluateRating);
    }

    /**
     * 修改承包商综合评级
     * 
     * @param evaluateRating 承包商综合评级
     * @return 结果
     */
    @Override
    public int updateEvaluateRating(EvaluateRating evaluateRating)
    {
        evaluateRating.setUpdateTime(DateUtils.getNowDate());
        return evaluateRatingMapper.updateEvaluateRating(evaluateRating);
    }

    /**
     * 批量删除承包商综合评级
     * 
     * @param ids 需要删除的承包商综合评级主键
     * @return 结果
     */
    @Override
    public int deleteEvaluateRatingByIds(Long[] ids)
    {
        return evaluateRatingMapper.deleteEvaluateRatingByIds(ids);
    }

    /**
     * 删除承包商综合评级信息
     * 
     * @param id 承包商综合评级主键
     * @return 结果
     */
    @Override
    public int deleteEvaluateRatingById(Long id)
    {
        return evaluateRatingMapper.deleteEvaluateRatingById(id);
    }
}
